package ooday02;

public class ExtendsText {
    public static void main(String[] args) {
        Student zg = new Student("张光", 25, "China", "jsd2408", "001");
        zg.study();
        zg.eat();
        zg.sayhello();
        zg.sleep();

        Teacher ll = new Teacher("李林", 28, "学校", "8000");
        ll.eat();
        ll.sayhello();
        ll.teach();
        ll.sleep();


        Doctor zw = new Doctor("张伟", 35, "医院", "医生");
        zw.eat();
        zw.cut();
        zw.sayhello();
        zw.sleep();


        //演示超类不能访问派生类
        Person p = new Person();
        p.name = "r";
        p.address = "da";
        p.age = 4;
        p.eat();
        p.sleep();
        p.sayhello();
        //p.stuId = "005";编译错误，超类不能访问派生类


    }
}
